<template>
	<view class="list">
		<view class="list-item" v-for="(item,index) in data" :key="index">
			<view class="cell">
				<view class="">抬头类型：个人/非企业单位</view>
				<view class="price">50.00元</view>
			</view>
			<view class="cell">
				<view class="">发票抬头：解景青</view>
				<view class="price"></view>
			</view>
			<view class="cell">
				<view class="">发票项目：通信服务费</view>
				<view class="submit" @click="handleDetails(index)">{{item.show?'收起详情':'展开详情'}}</view>
			</view>
			<view class="details" v-if="item.show">
				<view class="cell">
					<view class="">发票税号：911101087426483758</view>
					<view class="price"></view>
				</view>
				<view class="cell">
					<view class="">联系地址：</view>
					<view class="price"></view>
				</view>
				<view class="cell">
					<view class="">联系电话：18618391562</view>
					<view class="price"></view>
				</view>
				<view class="cell">
					<view class="">开户银行：招商银行上地支行</view>
					<view class="price"></view>
				</view>
				<view class="cell">
					<view class="">银行账号：1234 1234 1234 1234</view>
					<view class="price"></view>
				</view>
				<view class="cell">
					<view class="">接收邮箱：xiejq@litsoft.com.cn</view>
					<view class="price"></view>
				</view>
				<view class="cell">
					<view class="">开票时间：2022-09-02 11:11:11</view>
					<view class="price"></view>
				</view>
			</view>
		</view>
		
	</view>
</template>
<script>
export default {
	name: 'InvoiceTabs1',
	props:{
		tabsData:{
			type: Array,
			default:() => []
		}
	},
	data(){
		return{
			data:[]
		}
	},
	methods:{
		handleDetails(index){
			this.data[index].show = !this.data[index].show
		}
	},
	created() {
		this.data = this.tabsData.filter(item=>{
			item.show = false
			return item
		})
		console.log('查看内容',this.tabsData)
	}
}
</script>

<style lang="scss" scoped>
	.list{
		.list-item{
			margin-top: 30rpx;
			padding: 20px;
			box-shadow: 0 0 4px #cccccc;
			.cell{
				display: flex;
				justify-content: space-between;
				margin-top: 20rpx;
				.price{
					color: red;
					font-weight: bold;
				}
				.submit{
					color: white;
					background-color: red;
					padding: 6rpx 20rpx;
					font-size: 28rpx;
					border-radius: 8rpx;
				}
			}
		}
	}
</style>